﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SU.Center.Infa.Migrations
{
    public partial class Updatedatabase : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Dbset",
                columns: table => new
                {
                    BreedId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BreedName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedSource = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedDay = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedBrand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedPeople = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedTiem = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ProductId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Dbset", x => x.BreedId);
                });

            migrationBuilder.CreateTable(
                name: "Healths",
                columns: table => new
                {
                    HealthId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    HealthName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HealthMethod = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProductId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Healths", x => x.HealthId);
                });

            migrationBuilder.CreateTable(
                name: "Immunities",
                columns: table => new
                {
                    ImmunityId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Immunityfactory = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Immunitynumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProductId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Immunities", x => x.ImmunityId);
                });

            migrationBuilder.CreateTable(
                name: "Information",
                columns: table => new
                {
                    InformationId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductId = table.Column<int>(type: "int", nullable: false),
                    InformationBatch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationDay = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationCertificate = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationEnterprise = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationImprove = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationCreate = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationTiem = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationModify = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InformationDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Information", x => x.InformationId);
                });

            migrationBuilder.CreateTable(
                name: "PictureInfos",
                columns: table => new
                {
                    PictureInfoId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InformationId = table.Column<int>(type: "int", nullable: false),
                    TraceType = table.Column<int>(type: "int", nullable: false),
                    ImageType = table.Column<int>(type: "int", nullable: false),
                    ImageUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PictureInfos", x => x.PictureInfoId);
                });

            migrationBuilder.CreateTable(
                name: "ProcessingEnterprises",
                columns: table => new
                {
                    ProcessingEnterprisesId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProcessingEnterprisesName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProcessingEnterprisesXK = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProcessingEnterprises", x => x.ProcessingEnterprisesId);
                });

            migrationBuilder.CreateTable(
                name: "ProcessingInformation",
                columns: table => new
                {
                    ProcessingInformationId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InformationId = table.Column<int>(type: "int", nullable: false),
                    ProcessingInformationName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProcessingInformationFZR = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProcessingInformation", x => x.ProcessingInformationId);
                });

            migrationBuilder.CreateTable(
                name: "Products",
                columns: table => new
                {
                    ProductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Products", x => x.ProductId);
                });

            migrationBuilder.CreateTable(
                name: "RawMaterials",
                columns: table => new
                {
                    RawMaterialId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InformationId = table.Column<int>(type: "int", nullable: false),
                    RawMaterialName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RawMaterials", x => x.RawMaterialId);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterInformation",
                columns: table => new
                {
                    SlaughterInformationId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InformationId = table.Column<int>(type: "int", nullable: false),
                    SlaughterInformationNmae = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughterInformationTiem = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterInformationTiemEnd = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterInformation", x => x.SlaughterInformationId);
                });

            migrationBuilder.CreateTable(
                name: "SlaughteringEnterprises",
                columns: table => new
                {
                    SlaughteringEnterprisesId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    InformationId = table.Column<int>(type: "int", nullable: false),
                    SlaughteringEnterprisesName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughteringEnterpriseDZ = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SlaughteringEnterpriseJZ = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughteringEnterprises", x => x.SlaughteringEnterprisesId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Dbset");

            migrationBuilder.DropTable(
                name: "Healths");

            migrationBuilder.DropTable(
                name: "Immunities");

            migrationBuilder.DropTable(
                name: "Information");

            migrationBuilder.DropTable(
                name: "PictureInfos");

            migrationBuilder.DropTable(
                name: "ProcessingEnterprises");

            migrationBuilder.DropTable(
                name: "ProcessingInformation");

            migrationBuilder.DropTable(
                name: "Products");

            migrationBuilder.DropTable(
                name: "RawMaterials");

            migrationBuilder.DropTable(
                name: "SlaughterInformation");

            migrationBuilder.DropTable(
                name: "SlaughteringEnterprises");
        }
    }
}
